fix(workflows): pass globalSearchPath to all discoverWorkflowsWithConfig callers#1257
fix(workflows): pass globalSearchPath to all discoverWorkflowsWithConfig callers#1257
Conversation
…fig callers (#1138) Global workflows in ~/.archon/.archon/workflows/ were invisible to webhook commands and the web UI because 4 call sites omitted the globalSearchPath option that the CLI already passes correctly. Changes: - Add getArchonHome import to command-handler.ts - Pass { globalSearchPath: getArchonHome() } at 3 call sites in command-handler.ts (list, reload, run) - Pass { globalSearchPath: getArchonHome() } at 1 call site in api.ts (GET /api/workflows) - Update tests to expect the new globalSearchPath argument Fixes #1138 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🔍 Comprehensive PR ReviewPR: #1257 — fix(workflows): pass globalSearchPath to all discoverWorkflowsWithConfig callers SummaryThis is a minimal, targeted fix that threads Verdict: ✅
🟡 Medium Issues (No Blockers — Follow-up Recommended)1. Pre-existing gap:
|
| Title | Priority |
|---|---|
fix(workflows): pass globalSearchPath to validate.ts and orchestrator-agent.ts:1434 |
P2 |
test(workflows): pin getArchonHome mock value in command-handler and api tests |
P3 |
Next Steps
- ✅ This PR is ready to approve and merge — no blocking issues
- 📝 Create follow-up issue for
validate.ts+orchestrator-agent.ts:1434(same root cause as Global workflows invisible to webhook commands and web UI #1138) - 🎯 Optionally tighten test assertions in this PR or defer to the follow-up
Reviewed by Archon comprehensive-pr-review workflow
Artifacts: ~/.archon/workspaces/coleam00/Archon/artifacts/runs/bd4c902d9ec93a1b33751c278b909d8e/review/
Pass globalSearchPath to validate.ts and orchestrator-agent.ts:1434 call sites (same root cause as #1138), add getArchonHome mock to command-handler tests and pin path assertions, add signature-assertion tests for reload and run call sites, and update orchestrator.test.ts assertion to match new 3-arg signature. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Self-Fix Report (Aggressive)Status: COMPLETE Fixes Applied (5 total)
ValidationType check | Lint | Tests Self-fix by Archon · aggressive mode |
The comment "Discover workflows with error handling" describes exactly what the surrounding try/catch and discoverWorkflowsWithConfig call already make clear without it. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Archon PR Validation ReportVerdict: APPROVE SummaryGlobal workflows in Bug Confirmation
Fix Quality
IssuesNo blocking issues found. Validated by archon-validate-pr workflow |
Summary
~/.archon/.archon/workflows/were invisible to GitHub webhook commands and the Web UI becausediscoverWorkflowsWithConfigwas called without theglobalSearchPathoption at 4 call sites.getArchonHomeimport tocommand-handler.tsand passed{ globalSearchPath: getArchonHome() }at 3 call sites incommand-handler.tsand 1 call site inapi.ts(GET /api/workflows). Updated 2 existing tests that asserted the exact call signature.discoverWorkflowsWithConfigitself, the CLI (already correct), the orchestrator, and all other API routes.UX Journey
Before
After
Architecture Diagram
Before
After
Connection inventory:
command-handler.tsdiscoverWorkflowsWithConfigglobalSearchPath(3 call sites)api.tsdiscoverWorkflowsWithConfigglobalSearchPath(1 call site)command-handler.tsgetArchonHome@archon/pathsLabel Snapshot
risk: lowsize: XScore,servercore:command-handler,server:apiChange Metadata
bugmultiLinked Issue
Validation Evidence (required)
--max-warnings 0)Notable test counts: @archon/web 101 pass, @archon/core 68+97+2 pass, @archon/workflows multiple batches all passing.
No commands skipped.
Security Impact (required)
getArchonHome()already used by CLI at these same call sites; this aligns server/handler paths with existing CLI behavior.Compatibility / Migration
globalSearchPathwas optional before and remains so in the function signatureHuman Verification (required)
globalSearchPathargs exactly mirror the CLI pattern inpackages/cli/src/commands/workflow.ts:123discoverWorkflowsWithConfig— returns empty, no error); duplicate names between global and repo-local (existing load-priority logic already resolves in favor of repo-local)~/.archon/.archon/workflows/and hitting the API — all automated checks passSide Effects / Blast Radius (required)
/workflow list,/workflow reload,/workflow runcommands; Web UI Workflows tab (GET /api/workflows)~/.archon/.archon/workflows/does not exist,discoverWorkflowsWithConfigsilently skips it (existing behavior for the global path)/workflow listoutput now includes global workflows; no new monitoring neededRollback Plan (required)
git revert HEAD— single commit, 4 one-line removalsdiscoverWorkflowsWithConfigpriority logicRisks and Mitigations